<table>
	<tr>
		<td>Автор блога</td>
		<td>
			<select id="blockProperties_author">
				<option value="0">- Выбрать -</option>
				{foreach $users as $user}
					<option{if $blog && $blog->owner == $user->id} selected="selected"{/if} value="{$user->id}">{$user->login}</option>
				{/foreach}
			</select>
		</td>
	</tr>
	<tr>
		<td>Блог</td>
		<td>
			<select id="blockProperties_blog" name="block[Properties][blog]"></select>
		</td>
	</tr>
</table>
<script type="text/javascript">
b();

$('#blockProperties_author').live('change', function(){
	b();
});

function b(){
	user = $('#blockProperties_author option:selected').val();
	if(user == 0) {
		$('#blockProperties_blog').html("");
		return;
	}
	loadBlogs(user);
}

function loadBlogs(user){
	$.ajax({
		'url': '?module=blogs&action=user_blogs&user='+ user,
		'dataType': 'html',
		'beforeSend': function(){
			$('#blockProperties_blog').addClass('load');
		},
		'success': function(html){
			$('#blockProperties_blog').removeClass('load');
			$('#blockProperties_blog').html(html);
		}
	});
}
</script>